<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: 26488
  Date: 2022/2/25
  Time: 16:13
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>用户主页</title>
    <%@ include file="/basePath.jsp" %>
    <meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"/>
    <link rel="stylesheet" href="statics/bootstrap/css/bootstrap.css">
</head>
<body>
<script type="text/javascript" src="statics/js/Popper.js"></script> <!--放在bootstrap.js前面-->
<script src="statics/js/jquery-3.6.0.js"></script>
<script src="statics/bootstrap/js/bootstrap.js"></script>
<script>
    $(function () {
        $(document).on("click", "#logout", function () {
            if (confirm("你确定要退出登录吗？")) {
                location.href = "logout";
            }
        })
        //var flag = 1;
        // $("#appMaintain").click(function () {
        //     var devId = $("#devId").attr("devId");
        //     if (flag === 1) {
        //         $("#welcome").addClass("d-none");
        //         $("#appMaintainPage").removeClass("d-none");
        //         flag = 0;
        //     } else {
        //         $("#welcome").removeClass("d-none");
        //         $("#appMaintainPage").addClass("d-none");
        //         flag = 1;
        //     }
        //     event.preventDefault();
        // })

        function updateList(result) {
            var pageTotal = result.extend.pageInfo.total;//总记录数
            var pages = result.extend.pageInfo.pages;//页数
            var pageN = result.extend.pageInfo.pageSize;//页大小
            var page = parseInt(pageTotal % pageN);//最后一页的个数
            if (page == 0) { //刚好最后一页满了
                pageN = result.extend.pageInfo.pageSize;
                for (var i = 0; i < pageN; i++) {
                    // $("table tbody tr").eq(i).children('td').eq(0).children('input').prop("checked",false);
                    $("table tbody tr").eq(i).children('td').eq(0).text(result.extend.pageInfo.list[i].softwareName);
                    $("table tbody tr").eq(i).children('td').eq(1).text(result.extend.pageInfo.list[i].apkName);
                    $("table tbody tr").eq(i).children('td').eq(2).text(result.extend.pageInfo.list[i].sofewareSize);
                    $("table tbody tr").eq(i).children('td').eq(3).text(result.extend.pageInfo.list[i].flatform.flatform);
                    $("table tbody tr").eq(i).children('td').eq(4).text(result.extend.pageInfo.list[i].categoryLevel1.name + "->" + result.extend.pageInfo.list[i].categoryLevel2.name + "->" + result.extend.pageInfo.list[i].categoryLevel3.name);
                    $("table tbody tr").eq(i).children('td').eq(5).text(result.extend.pageInfo.list[i].status.status);
                    $("table tbody tr").eq(i).children('td').eq(6).text(result.extend.pageInfo.list[i].downloads);
                    $("table tbody tr").eq(i).children('td').eq(7).text(result.extend.versions[i].versionNo);
                    $("table tbody tr").eq(i).children('td').eq(8).find("a:eq(6)").attr("hidden",false);
                    $("table tbody tr").eq(i).children('td').eq(8).find("a:eq(5)").attr("hidden",false);
                    $("table tbody tr").eq(i).children('td').eq(8).find("a:eq(4)").attr("href", "toAppInfoAndVersion" + "/" + result.extend.pageInfo.list[i].devId + "/" + result.extend.pageInfo.list[i].id + "/" + result.extend.versions[i].id + "/" + result.extend.pageInfo.pageNum);
                    $("table tbody tr").eq(i).children('td').eq(8).find("a:eq(3)").attr("href", "deleteApp" + "/" + result.extend.pageInfo.list[i].devId + "/" + result.extend.pageInfo.list[i].id + "/" + result.extend.pageInfo.pageNum + "/" + result.extend.pageInfo.size);
                    $("table tbody tr").eq(i).children('td').eq(8).find("a:eq(2)").attr("href", "toModifyAppInfo" + "/" + result.extend.pageInfo.list[i].devId + "/" + result.extend.pageInfo.list[i].id);
                    $("table tbody tr").eq(i).children('td').eq(8).find("a:eq(1)").attr("href", "toModifyVersion" + "/" + result.extend.pageInfo.list[i].devId + "/" + result.extend.pageInfo.list[i].id + "/" + result.extend.versions[i].id);
                    $("table tbody tr").eq(i).children('td').eq(8).find("a:eq(0)").attr("href", "toAddVersion" + "/" + result.extend.pageInfo.list[i].devId + "/" + result.extend.pageInfo.list[i].id);
                }
            } else {//刚好最后一页未满
                if (result.extend.pageInfo.pageNum !== parseInt(pages)) {
                    pageN = result.extend.pageInfo.pageSize;
                    for (var i = 0; i < pageN; i++) {
                        // $("table tbody tr").eq(i).children('td').eq(0).children('input').prop("checked",false);
                        $("table tbody tr").eq(i).children('td').eq(0).text(result.extend.pageInfo.list[i].softwareName);
                        $("table tbody tr").eq(i).children('td').eq(1).text(result.extend.pageInfo.list[i].apkName);
                        $("table tbody tr").eq(i).children('td').eq(2).text(result.extend.pageInfo.list[i].sofewareSize);
                        $("table tbody tr").eq(i).children('td').eq(3).text(result.extend.pageInfo.list[i].flatform.flatform);
                        $("table tbody tr").eq(i).children('td').eq(4).text(result.extend.pageInfo.list[i].categoryLevel1.name + "->" + result.extend.pageInfo.list[i].categoryLevel2.name + "->" + result.extend.pageInfo.list[i].categoryLevel3.name);
                        $("table tbody tr").eq(i).children('td').eq(5).text(result.extend.pageInfo.list[i].status.status);
                        $("table tbody tr").eq(i).children('td').eq(6).text(result.extend.pageInfo.list[i].downloads);
                        $("table tbody tr").eq(i).children('td').eq(7).text(result.extend.versions[i].versionNo);
                        $("table tbody tr").eq(i).children('td').eq(8).find("a:eq(6)").attr("hidden",false);
                        $("table tbody tr").eq(i).children('td').eq(8).find("a:eq(5)").attr("hidden",false);
                        $("table tbody tr").eq(i).children('td').eq(8).find("a:eq(4)").attr("href", "toAppInfoAndVersion" + "/" + result.extend.pageInfo.list[i].devId + "/" + result.extend.pageInfo.list[i].id + "/" + result.extend.versions[i].id + "/" + result.extend.pageInfo.pageNum);
                        $("table tbody tr").eq(i).children('td').eq(8).find("a:eq(3)").attr("href", "deleteApp" + "/" + result.extend.pageInfo.list[i].devId + "/" + result.extend.pageInfo.list[i].id + "/" + result.extend.pageInfo.pageNum + "/" + result.extend.pageInfo.size);
                        $("table tbody tr").eq(i).children('td').eq(8).find("a:eq(2)").attr("href", "toModifyAppInfo" + "/" + result.extend.pageInfo.list[i].devId + "/" + result.extend.pageInfo.list[i].id);
                        $("table tbody tr").eq(i).children('td').eq(8).find("a:eq(1)").attr("href", "toModifyVersion" + "/" + result.extend.pageInfo.list[i].devId + "/" + result.extend.pageInfo.list[i].id + "/" + result.extend.versions[i].id);
                        $("table tbody tr").eq(i).children('td').eq(8).find("a:eq(0)").attr("href", "toAddVersion" + "/" + result.extend.pageInfo.list[i].devId + "/" + result.extend.pageInfo.list[i].id);
                    }
                } else {
                    pageN = page;
                    for (var i = 0; i < pageN; i++) {
                        // $("table tbody tr").eq(i).children('td').eq(0).children('input').prop("checked",false);
                        $("table tbody tr").eq(i).children('td').eq(0).text(result.extend.pageInfo.list[i].softwareName);
                        $("table tbody tr").eq(i).children('td').eq(1).text(result.extend.pageInfo.list[i].apkName);
                        $("table tbody tr").eq(i).children('td').eq(2).text(result.extend.pageInfo.list[i].sofewareSize);
                        $("table tbody tr").eq(i).children('td').eq(3).text(result.extend.pageInfo.list[i].flatform.flatform);
                        $("table tbody tr").eq(i).children('td').eq(4).text(result.extend.pageInfo.list[i].categoryLevel1.name + "->" + result.extend.pageInfo.list[i].categoryLevel2.name + "->" + result.extend.pageInfo.list[i].categoryLevel3.name);
                        $("table tbody tr").eq(i).children('td').eq(5).text(result.extend.pageInfo.list[i].status.status);
                        $("table tbody tr").eq(i).children('td').eq(6).text(result.extend.pageInfo.list[i].downloads);
                        $("table tbody tr").eq(i).children('td').eq(7).text(result.extend.versions[i].versionNo);
                        $("table tbody tr").eq(i).children('td').eq(8).find("a:eq(6)").attr("hidden",false);
                        $("table tbody tr").eq(i).children('td').eq(8).find("a:eq(5)").attr("hidden",false);
                        $("table tbody tr").eq(i).children('td').eq(8).find("a:eq(4)").attr("href", "toAppInfoAndVersion" + "/" + result.extend.pageInfo.list[i].devId + "/" + result.extend.pageInfo.list[i].id + "/" + result.extend.versions[i].id + "/" + result.extend.pageInfo.pageNum);
                        $("table tbody tr").eq(i).children('td').eq(8).find("a:eq(3)").attr("href", "deleteApp" + "/" + result.extend.pageInfo.list[i].devId + "/" + result.extend.pageInfo.list[i].id + "/" + result.extend.pageInfo.pageNum + "/" + result.extend.pageInfo.size);
                        $("table tbody tr").eq(i).children('td').eq(8).find("a:eq(2)").attr("href", "toModifyAppInfo" + "/" + result.extend.pageInfo.list[i].devId + "/" + result.extend.pageInfo.list[i].id);
                        $("table tbody tr").eq(i).children('td').eq(8).find("a:eq(1)").attr("href", "toModifyVersion" + "/" + result.extend.pageInfo.list[i].devId + "/" + result.extend.pageInfo.list[i].id + "/" + result.extend.versions[i].id);
                        $("table tbody tr").eq(i).children('td').eq(8).find("a:eq(0)").attr("href", "toAddVersion" + "/" + result.extend.pageInfo.list[i].devId + "/" + result.extend.pageInfo.list[i].id);
                    }
                    for (var i = pageN; i < result.extend.pageInfo.pageSize; i++) {
                        // $("table tbody tr").eq(i).children('td').eq(0).children("input").prop("checked",false);
                        $("table tbody tr").eq(i).children('td').eq(0).text(" ");
                        $("table tbody tr").eq(i).children('td').eq(1).text(" ");
                        $("table tbody tr").eq(i).children('td').eq(2).text(" ");
                        $("table tbody tr").eq(i).children('td').eq(3).text(" ");
                        $("table tbody tr").eq(i).children('td').eq(4).text(" ");
                        $("table tbody tr").eq(i).children('td').eq(5).text(" ");
                        $("table tbody tr").eq(i).children('td').eq(6).text(" ");
                        $("table tbody tr").eq(i).children('td').eq(7).text(" ");
                        $("table tbody tr").eq(i).children('td').eq(8).find("a:eq(6)").attr("hidden",true);
                        $("table tbody tr").eq(i).children('td').eq(8).find("a:eq(5)").attr("hidden",true);
                        $("table tbody tr").eq(i).children('td').eq(8).find("a:eq(4)").removeAttr("href");
                        $("table tbody tr").eq(i).children('td').eq(8).find("a:eq(3)").removeAttr("href");
                        $("table tbody tr").eq(i).children('td').eq(8).find("a:eq(2)").removeAttr("href");
                        $("table tbody tr").eq(i).children('td').eq(8).find("a:eq(1)").removeAttr("href");
                        $("table tbody tr").eq(i).children('td').eq(8).find("a:eq(0)").removeAttr("href");
                    }
                }
            }
            $("#nowPageNum").val(result.extend.pageInfo.pageNum);
            $("#nowPages").val(result.extend.pageInfo.pages);
            $("#nowPageTotal").val(result.extend.pageInfo.total);
        }


        function np(){
        $("#next").click(function () {
            var pageNumber = parseInt($("#nowPageNum").val()) + 1;
            var pages = $("#nowPages").val();
            var devId = $("#devId").attr("devId");
            var softwareName = $("#softwareName").val();
            if(softwareName === ""){
                softwareName = "null";
            }
            console.log(softwareName);
            var status = $("#status").val();
            if(status == ""){
                status = 0;
            }
            var flatformId = $("#flatformId").val();
            if(flatformId == ""){
                flatformId = 0;
            }
            var categoryLevel1 = $("#categoryLevel1").val();
            if(categoryLevel1 == ""){
                categoryLevel1 = 0;
            }
            var categoryLevel2 = $("#categoryLevel2").val();
            if(categoryLevel2 == ""){
                categoryLevel2 = 0;
            }
            var categoryLevel3 = $("#categoryLevel3").val();
            if(categoryLevel3 == ""){
                categoryLevel3 = 0;
            }
            if (pageNumber > pages) {
            } else {
                // $.getJSON("listWithAjax/" + devId + "/" + pageNumber + "?softwareName=" + softwareName + "&status=" + status + "&flatformId=" + flatformId + "&categoryLevel1=" + categoryLevel1 + "&categoryLevel2=" + categoryLevel2 + "&categoryLevel3=" + categoryLevel3, function (result) {
                //     //updateList(result);
                // })
                $("#resultList").load("list/" + devId + "/" + pageNumber + "?softwareName=" + softwareName + "&status=" + status + "&flatformId=" + flatformId + "&categoryLevel1=" + categoryLevel1 + "&categoryLevel2=" + categoryLevel2 + "&categoryLevel3=" + categoryLevel3 + "  #resultList" ,{} ,function (){
                    np();
                });

            }
            event.preventDefault();
        })

        $("#previous").click(function () {
            var pageNumber = parseInt($("#nowPageNum").val()) - 1;
            var devId = $("#devId").attr("devId");
            var softwareName = $("#softwareName").val();
            if(softwareName === ""){
                softwareName = "null";
            }
            console.log(softwareName);
            var status = $("#status").val();
            if(status == ""){
                status = 0;
            }
            var flatformId = $("#flatformId").val();
            if(flatformId == ""){
                flatformId = 0;
            }
            var categoryLevel1 = $("#categoryLevel1").val();
            if(categoryLevel1 == ""){
                categoryLevel1 = 0;
            }
            var categoryLevel2 = $("#categoryLevel2").val();
            if(categoryLevel2 == ""){
                categoryLevel2 = 0;
            }
            var categoryLevel3 = $("#categoryLevel3").val();
            if(categoryLevel3 == ""){
                categoryLevel3 = 0;
            }
            if (pageNumber <= 0) {
            } else {
                // $.getJSON("listWithAjax/" + devId + "/" + pageNumber + "?softwareName=" + softwareName + "&status=" + status + "&flatformId=" + flatformId + "&categoryLevel1=" + categoryLevel1 + "&categoryLevel2=" + categoryLevel2 + "&categoryLevel3=" + categoryLevel3, function (result) {
                //         updateList(result);
                //     }
                // )
                $("#resultList").load("list/" + devId + "/" + pageNumber + "?softwareName=" + softwareName + "&status=" + status + "&flatformId=" + flatformId + "&categoryLevel1=" + categoryLevel1 + "&categoryLevel2=" + categoryLevel2 + "&categoryLevel3=" + categoryLevel3 + "  #resultList" ,{} ,function (){
                    np();
                });;
            }
            event.preventDefault();
        })
        $(".dropdownMenu").click(function () {
            var status = $(this).parent().parent().parent().find("td:eq(5)").text();
            if (status === "审核通过" || status === "已下架") {
                $(this).parent().find("div:eq(0)").children('a').eq(6).attr("hidden",true);
            } else if (status === "已上架") {
                $(this).parent().find("div:eq(0)").children('a').eq(5).attr("hidden",true);
            }else{
                $(this).parent().find("div:eq(0)").children('a').eq(5).attr("hidden",true);
                $(this).parent().find("div:eq(0)").children('a').eq(6).attr("hidden",true);
            }
        })

        //点击修改
        $(".modify").click(function () {
            var status = $(this).parent().parent().parent().parent().find("td:eq(5)").text();
            if (status === "审核通过" || status === "已上架" || status === "已下架") {
                alert("该APP应用的状态为: [ " + status + "]，不能修改");
                return false;
            }
        })
        //点击修改版本
        $(".modifyVersion").click(function () {
            var versionNo = $(this).parent().parent().parent().parent().find("td:eq(7)").text();
            var status = $(this).parent().parent().parent().parent().find("td:eq(5)").text();
            console.log(versionNo);
            console.log("hh");
            if (versionNo === "") {
                alert("该APP应用无版本信息，请先增加版本信息！");
                return false;
            }
            if (status === "审核通过" || status === "已上架" || status === "已下架") {
                alert("该APP应用的状态为: [ " + status + "]，不能修改其版本信息，只可以进行【新增版本】操作！");
                return false;
            }
        })
        //点击删除app以及其所有版本
        $(".deleteApp").click(function () {
            var softwareName = $(this).parent().parent().parent().parent().find("td:eq(0)").text();
            var attr = $(this).attr("href");
            if (confirm("你确定要删除【" + softwareName + "】吗?")) {
                $.getJSON(attr, function (result) {
                    updateList(result);
                })
                // $("#resultList").load(attr + "  #resultList" ,{} ,function (){
                //     np();
                // });
                return false;
            } else {
                return false;
            }
        })
        //上架
        $(".putaway").click(function () {
            console.log("putaway");
            var softwareName = $(this).parent().parent().parent().parent().find("td:eq(0)").text();
            var devId = $("#devId").attr("devId");
            var appId = $(this).parent().attr("appId");
            var pageNumber = $("#nowPageNum").val();
            if(confirm("你确定要将【" + softwareName +"】上架吗?")){
                $.getJSON("updateStatus/"+devId+"/"+appId+"/"+pageNumber+"/4",function (result){
                    updateList(result);
                })
                // $("#resultList").load("updateStatus/"+devId+"/"+appId+"/"+pageNumber+"/4", + "  #resultList" ,{} ,function (){
                //     np();
                // });
                return false;
            }
            return false;
        })
        //下架
        $(".soldOut").click(function () {
            var softwareName = $(this).parent().parent().parent().parent().find("td:eq(0)").text();
            var devId = $("#devId").attr("devId");
            var appId = $(this).parent().attr("appId");
            var pageNumber = $("#nowPageNum").val();
            if(confirm("你确定要将【" + softwareName +"】下架吗?")){
                $.getJSON("updateStatus/"+devId+"/"+appId+"/"+pageNumber+"/5",function (result){
                    updateList(result);
                })
                return false;
            }
            return false;
        })
        }
        np();
        $("#categoryLevel1").change(function () {
            $("#categoryLevel2").empty();
            $("#categoryLevel3").empty();
            var fid = $("#categoryLevel1").val();
            console.log(fid);
            $.getJSON("secondLevel/" + fid, function (result) {
                $("<option>").append("请选择").val("0").appendTo($("#categoryLevel2"))
                $.each(result.extend.secondLevels, function () {
                    var options = $("<option>").val(this.id).append(this.name);
                    options.appendTo($("#categoryLevel2"));
                })
            })
        })
        $("#categoryLevel2").change(function () {
            $("#categoryLevel3").empty();
            var sid = $("#categoryLevel2").val();
            $.getJSON("thirdLevel/" + sid, function (result) {
                $("<option>").append("请选择").val("0").appendTo($("#categoryLevel3"))
                $.each(result.extend.thirdLevels, function () {
                    var options = $("<option>").val(this.id).append(this.name);
                    options.appendTo($("#categoryLevel3"));
                })
            })
        })
    })
</script>
<div class="container-fluid border" style="height: 580px;min-width: 1220px;">
    <div class="row h-100">
        <jsp:include page="common.jsp"></jsp:include>
        <div class="col-10 bg-white d-flex flex-column border">
            <div class="h-100" id="appMaintainPage">
                <div class="border p-3">
                    <h2 style="font-size: 18px;">APP 信息管理维护 <small class="ml-3 text-danger">${sessionScope.dev.devName}:您可以通过搜索或筛选来对APP的信息进行修改、删除等管理操作</small>
                    </h2>
                </div>
                <div class="pt-1 pl-2 border" id="serchList">
                    <form class="" action="list/${devId}/1" method="post">
                        <div class="form-row">
                            <div class="form-group col-lg-4 form-row">
                                <label for="softwareName" class="col-4">软件名称:</label>
                                <input type="text" class="form-control col-6" id="softwareName" name="softwareName" value="${formMap.softwareName}">
                            </div>
                            <div class="form-group col-lg-4 form-row">
                                <label for="status" class="col-4">APP状态:</label>
                                <select id="status" name="status" class="form-control col-6" value="${formMap.status}">
                                    <option selected value="0">请选择</option>
                                    <c:forEach var="item" items="${status}" varStatus="xh">
                                        <c:if test="${formMap.status == item.id}">
                                            <option selected value="${item.id}">${item.status}</option>
                                        </c:if>
                                        <c:if test="${formMap.status != item.id}">
                                            <option value="${item.id}">${item.status}</option>
                                        </c:if>
                                    </c:forEach>
                                </select>
                            </div>
                            <div class="form-group col-lg-4 form-row ">
                                <label for="flatformId" class="col-4">所属平台:</label>
                                <select id="flatformId" name="flatformId" class="form-control col-6" value="${formMap.flatformId}">
                                    <option selected value="0">请选择</option>
                                    <c:forEach var="item" items="${flatforms}" varStatus="xh">
                                        <c:if test="${formMap.flatformId == item.id}">
                                            <option selected value="${item.id}">${item.flatform}</option>
                                        </c:if>
                                        <c:if test="${formMap.flatformId != item.id}">
                                            <option value="${item.id}">${item.flatform}</option>
                                        </c:if>
                                    </c:forEach>
                                </select>
                            </div>
                        </div>
                        <div class="form-row">
                            <div class="form-group col-lg-4 form-row ">
                                <label for="categoryLevel1" class="col-4">一级分类:</label>
                                <select id="categoryLevel1" name="categoryLevel1" class="form-control col-6" value="${formMap.categoryLevel1}">
                                    <option selected value="0">请选择</option>
                                    <c:forEach var="item" items="${firstLevels}" varStatus="xh">
                                        <c:if test="${formMap.categoryLevel1 == item.id}">
                                             <option selected value="${item.id}">${item.name}</option>
                                        </c:if>
                                        <c:if test="${formMap.categoryLevel1 != item.id}">
                                            <option value="${item.id}">${item.name}</option>
                                        </c:if>
                                    </c:forEach>
                                </select>
                            </div>
                            <div class="form-group col-lg-4 form-row ">
                                <label for="categoryLevel2" class="col-4">二级分类:</label>
                                <select id="categoryLevel2" name="categoryLevel2" class="form-control col-6" value="${formMap.categoryLevel2}">
                                    <option value="0">请选择</option>
                                    <c:forEach var="item" items="${secondLevels}" varStatus="xh">
                                        <c:if test="${formMap.categoryLevel2 == item.id}">
                                            <option selected value="${item.id}">${item.name}</option>
                                        </c:if>
                                        <c:if test="${formMap.categoryLevel2 != item.id}">
                                            <option value="${item.id}">${item.name}</option>
                                        </c:if>
                                    </c:forEach>
                                </select>
                            </div>
                            <div class="form-group col-lg-4 form-row ">
                                <label for="categoryLevel3" class="col-4">三级分类:</label>
                                <select id="categoryLevel3" name="categoryLevel3" class="form-control col-6" value="${formMap.categoryLevel3}">
                                    <option  value="0">请选择</option>
                                    <c:forEach var="item" items="${thirdLevels}" varStatus="xh">
                                        <c:if test="${formMap.categoryLevel3 == item.id}">
                                            <option selected value="${item.id}">${item.name}</option>
                                        </c:if>
                                        <c:if test="${formMap.categoryLevel3 != item.id}">
                                            <option value="${item.id}">${item.name}</option>
                                        </c:if>
                                    </c:forEach>
                                </select>
                            </div>
                        </div>
                        <button type="submit" id="find" class="btn btn-info">查找</button>
                    </form>
                </div>
                <a href="toAddAppInfo/${devId}" id="addApoInfo" class="btn btn-info float-right">新增App基础信息</a>
                <div id="resultList" class="border table-responsive">
                    <table class="table table-striped table-info" style="font-size: 14px;">
                        <thead>
                        <tr>
                            <th scope="col">软件名称</th>
                            <th scope="col">APK名称</th>
                            <th scope="col">软件大小</th>
                            <th scope="col">所属平台</th>
                            <th scope="col">所属分类(一级分类、二级分类、三级分类)</th>
                            <th scope="col">状态</th>
                            <th scope="col">下载次数</th>
                            <th scope="col">最新版本号</th>
                            <th scope="col">操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        <c:forEach var="i" begin="0" end="${pageInfo.pageSize - 1}">
                            <tr>
                                <td>${pageInfo.list[i].softwareName}</td>
                                <td>${pageInfo.list[i].apkName}</td>
                                <td>${pageInfo.list[i].sofewareSize}</td>
                                <td>${pageInfo.list[i].flatform.flatform}</td>
                                <td>
                                    <c:if test="${pageInfo.list[i].categoryLevel1.name == null}">
                                    </c:if>
                                    <c:if test="${pageInfo.list[i].categoryLevel1.name != null}">
                                        ${pageInfo.list[i].categoryLevel1.name}->${pageInfo.list[i].categoryLevel2.name}->${pageInfo.list[i].categoryLevel3.name}</td>
                                </c:if>
                                <td>${pageInfo.list[i].status.status}</td>
                                <td>${pageInfo.list[i].downloads}</td>
                                <td>${versions[i].versionNo}</td>
                                <td>
                                    <c:if test="${pageInfo.list[i].softwareName != null}">
                                        <div class="dropdown">
                                            <button class="btn btn-dark dropdown-toggle dropdownMenu" type="button"
                                                    id="dropdown" data-toggle="dropdown" aria-expanded="false">
                                                点击操作
                                            </button>
                                            <div class="dropdown-menu dropdownList" aria-labelledby="dropdown" appId="${pageInfo.list[i].id}" statusId="${pageInfo.list[i].status.id}">
                                                <a class="dropdown-item addVersion"
                                                   href="toAddVersion/${devId}/${pageInfo.list[i].id}" target="_blank">新增版本</a>
                                                <a class="dropdown-item modifyVersion"
                                                   href="toModifyVersion/${devId}/${pageInfo.list[i].id}/${versions[i].id}"
                                                   target="_blank">修改版本</a>
                                                <a class="dropdown-item modify"
                                                   href="toModifyAppInfo/${devId}/${pageInfo.list[i].id}"
                                                   title="修改APP基础信息" target="_blank">修改</a>
                                                <a class="dropdown-item deleteApp"
                                                   href="deleteApp/${devId}/${pageInfo.list[i].id}/${pageInfo.pageNum}/${pageInfo.size}">删除</a>
                                                <a class="dropdown-item"
                                                   href="toAppInfoAndVersion/${devId}/${pageInfo.list[i].id}/${versions[i].id}/${pageInfo.pageNum}"
                                                   target="_blank">查看</a>
                                                <a class="dropdown-item putaway" href="#">上架</a>
                                                <a class="dropdown-item soldOut" href="#">下架</a>
                                            </div>
                                        </div>
                                    </c:if>
                                </td>
                            </tr>
                        </c:forEach>
                        </tbody>
                    </table>
                    <div class="row">
                    <div class="col-5" style="font-size: 0.7rem;">
                        当前为 <input type="text" value="${pageInfo.pageNum}" class="pageNum text-center" id="nowPageNum"
                                   style="max-width: 2rem;" readonly> 页,总共 <input type="text" value="${pageInfo.pages}"
                                                                                  class="text-center" id="nowPages"
                                                                                  style="max-width: 2rem;" readonly> 页，共
                        <input
                                type="text" value="${pageInfo.total}" style="max-width: 2rem;" readonly
                                class="text-center"
                                id="nowPageTotal"> 条记录
                    </div>
                        <nav aria-label="Page navigation example" class="col-7">
                            <ul class="pagination justify-content-end">
                                <li class="page-item">
                                    <a class="page-link" href="javascript:;" id="previous">Previous</a>
                                </li>
                                <li class="page-item">
                                    <a class="page-link" href="#" id="next">Next</a>
                                </li>
                            </ul>
                        </nav>
                </div>
                </div>

            </div>

        </div>
    </div>
</div>
</body>
</html>
